<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <script src="/static/js/base.js"></script>
    <title>企业招聘</title>
    <link rel="stylesheet" href="/static/plugs/bootstrap/bootstrap.min.css">
    <link rel="stylesheet" href="/static/css/base.css">
    <link rel="stylesheet" href="/static/css/normalize.css">
    <script src="/static/plugs/jquery/jquery-3.1.1.min.js"></script>
    <script src="/static/plugs/bootstrap/bootstrap.bundle.min.js"></script>
    <script src="/static/js/base.js"></script>
    <script src="/static/js/helper.js"></script>
    <script>
        $(window).on('scroll', function(){
            let scrollTop = $(this).scrollTop(); // 获取垂直滚动条位置
            scrollTop = scrollTop > 300 ? 300 : scrollTop;
            let realOpacity = 1 - (scrollTop/300)*0.5;
            $(".index-bg").css(`opacity`, realOpacity);

            //$(".scroll").scrollTop(scrollTop);
        });
    </script>
    <style>
        /*总体布局*/
        body{
        }
        .index-bg{
            width: 100%;
            height:100%;
            background: url("/static/images/index-bg.jpg") fixed no-repeat;
            background-size:cover;
            position: fixed;
            opacity: 1;
            z-index: -1;
        }
        .wrap{
            width: 1440px;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            align-items: center;
            /*border:1px red solid;*/
        }

        /*top-tip布局*/
        .header{
            width: 1440px;
            height: 60px;
            background: rgba(255,255,255, 0.0);
            display: flex;
            justify-content: space-between;
            align-items: center;
            .weather-wrap{
                display: flex;
                .weather-icon{
                    margin:0 10px 0 20px;
                    width: 24px;
                    height: 24px;
                    background: url("/static/images/cloudy2.png") 100% 100%;
                    background-size: contain;
                }
            }
            .login-wrap{
                display: flex;
                .msg-icon{
                    width: 24px;
                    height: 24px;
                    background: url("/static/images/bell2.png") 100% 100%;
                    background-size: contain;
                }
                .msg{
                    margin:0 20px 0 10px;
                }
                .login-register{
                    margin-top: -10px;
                    border-radius: 15px;
                    padding: 5px 20px;
                    background: white;
                    font-size: 20px;
                    margin-right: 10px;
                    .slash1{
                        margin: 0 5px;
                    }
                }
                .userinfo{
                    position: relative;
                    display: none;
                    flex-direction: row;
                    align-items: center;
                    margin-right: 10px;
                    .userinfo-op{
                        width: 100px;
                        display: none;
                        flex-direction: column;
                        right: 0;
                        padding: 10px 20px;
                        font-size: 14px;
                        background: rgba(255, 255, 255,1);
                        border-radius: 5px;
                        position: absolute;
                        border:1px solid #cecece;
                        top:30px;
                        left:20px;
                    }
                }
                .userinfo img{
                    width:24px;
                    height: 24px;
                    margin-right: 10px;
                    border-radius: 50%;
                }
                .userinfo div{
                    margin-bottom: 10px;
                }
            }
        }

        /*问题tip布局*/
        .question-wrap{
            margin-top: 80px;
            width: 1440px;
            height: 50px;
            display: flex;
            flex-direction: row;
            justify-content: flex-end;
            font-size: 18px;
            /*border: 1px red solid;*/
            .question{
                display: flex;
                align-items: center;
                .question-icon{
                    width: 32px;
                    height:32px;
                    opacity: 0.8;
                    background: url("/static/images/eye.png") 100% 100%;
                    background-size: contain;
                }
                .question-title{
                    line-height: 50px;
                    margin-left: 10px;
                }
                .question-next-icon{
                    width: 50px;
                    height:32px;
                    padding: 4px;
                    /*border: 1px red solid;*/
                    opacity: 0.8;
                    background: url("/static/images/arrow-next.png") no-repeat left 100% ;
                    background-size: contain;
                }
            }
        }

        /*搜索框布局*/
        .search-wrap{
            width: 600px;
            height: 120px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            /*margin-top: 200px;*/
            /*border:1px red solid;*/
            .search-title-wrap{
                display: flex;
                justify-content: center;
                align-items: center;
                .search-title-icon{
                    width: 48px;
                    height: 48px;
                    background: url("/static/images/logo.png") 100% 100%;
                    background-size: contain;
                    margin-right: 20px;
                }
                .search-title{
                    color:darkmagenta;
                    font-size: 24px;
                    font-weight: bold;
                }
            }
            .search-input-wrap{
                position: relative;
                width: 600px;
                margin-top: 20px;
                .search-input{
                    width: 600px;
                    height: 50px;
                    padding-left: 30px;
                    border-radius: 25px;
                    border: 0.1pt solid rgba(200, 200, 200, 0.5);
                }
                .search-icon{
                    position: absolute;
                    z-index: 5;
                    opacity: 0.5;
                    top:10px;
                    left:550px;
                    width: 32px;
                    height: 32px;
                    background: url("/static/images/magnifier.png") 100% 100%;
                    background-size: contain;
                }
            }
        }

        /*导航条布局*/
        .nav{
            width: 1440px;
            margin-top: 20px;
            height: 60px;
            font-size: 24px;
            border-radius: 30px;
            display: flex;
            justify-content: space-around;
            align-items: center;
            background: #333333;
        }
        .nav div a{
            color:#FFFFFF;
        }

        /*新闻滑动框布局*/
        .contain{
            margin:50px 0 50px 0;
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            padding-bottom: 100px;
            .load-more{
                position: absolute;
                top:1420px;
                font-size: 26px;
                opacity: 0.5;
            }
        }
        .condi{
            width: 1440px;
            padding: 20px 20px;
            display: flex;
            flex-direction: column;
            /*border: 1px solid red;*/
            border-radius: 10px;
            background: white;
            .city{
                height: 30px;
                line-height: 30px;
                /*background: #00aeef;*/
                display: flex;
                flex-direction: row;
                .city-list{
                    display: flex;
                    flex-direction: row;
                }
                .city-list div{
                    margin-right: 20px;
                    font-size: 20px;
                }
            }
            .cate{
                height: 30px;
                line-height: 30px;
                display: flex;
                flex-direction: row;
                .cate-list{
                    display: flex;
                    flex-direction: row;
                }
                .cate-list div{
                    margin-right: 20px;
                    font-size: 20px;
                }
            }
            .salary{
                height: 30px;
                line-height: 30px;
                display: flex;
                flex-direction: row;
                .salary-list{
                    display: flex;
                    flex-direction: row;
                }
                .salary-list div{
                    margin-right: 20px;
                    font-size: 20px;
                }
            }
            .more-condi{
                height: 30px;
                line-height: 30px;
                display: flex;
                flex-direction: row;
                .select-wrap{
                    display: flex;
                }
                .select-wrap select{
                    width: 100px;
                    margin-right: 20px;
                }
            }
        }
        .list{
            width: 1440px;
            margin-top: 20px;
            background: white;
            border-radius: 10px;
            padding: 20px;
            font-size: 18px;
            display: flex;
            flex-direction: column;
            .item{
                height: 200px;
                margin-top: 10px;
                border: 1px solid rgba(240, 240, 240, 0.8);
                border-radius: 5px;
                display: flex;
                flex-direction: row;
                justify-content: space-between;
                margin-bottom: 20px;
                .item-left{
                    width: 1000px;
                    display: flex;
                    flex-direction: row;
                    .user-box{
                        width: 100px;
                        height: 200px;
                        display: flex;
                        flex-direction: column;
                        align-items: center;
                        justify-content: flex-start;
                        .user-thumb img{
                            margin-top: 10px;
                            width: 64px;
                            height: 64px;
                            border-radius: 50%;
                        }
                        .user-salary{
                            background: #FACD91;
                            margin-top: 10px;
                            padding: 2px 10px;
                            border-radius: 5px;
                        }
                    }
                    .job-box div{
                        height: 40px;
                        line-height: 40px;
                        font-size: 20px;
                    }
                    .job-box{
                        .user-name-box{
                            display: flex;
                            .user-name{
                                font-size: 20px;
                                font-weight: bold;
                            }
                            .date-update{
                                color: #D7D7D7;
                                margin-left: 20px;
                            }
                        }
                        .user-des span,.user-expect span, .user-experience span{
                            margin-right: 20px;
                            padding: 2px 8px;
                            background: #F2F2F2;
                        }
                    }
                }
                .item-right{
                    width: 200px;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                }
                .item-right a{
                    width: 150px;
                    height: 60px;
                    background: #8B9CAC;
                    border-radius: 5px;
                    line-height: 60px;
                    text-align: center;
                    color: white;
                }
            }
        }

        /*footer布局*/
        .footer-wrap{
            display: flex;
            justify-content: center;
            background: #cccccc;
        }
        .footer{
            width: 1440px;
            height: 60px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            .outer-link{
                display: flex;
                justify-content: space-around;
            }
        }
        .outer-link div a{
            margin-right: 20px;
        }
    </style>
</head>
<body>
<div class="index-bg"></div>
<div class="wrap">
    <div class="header">
        <div class="weather-wrap">
            <div class="city">重庆</div>
            <div class="weather-icon"></div>
            <div class="weather">多云 23℃</div>
        </div>
        <div class="login-wrap">
            <div class="msg-icon"></div>
            <div class="msg">消息</div>
            <div class="login-register">
                <a class="login" href="login.php">登录</a>
                <span class="slash1">|</span>
                <a class="register" href="register-type.php">注册</a>
            </div>
            <div class="userinfo">
                    <img class="user-thumb" src="" alt="用户头像">
                    <span class="user-nickname"></span>
                    <div class="userinfo-op">
                        <div><a href="/user-center/index.php">个人中心</a></div>
                        <div><a href="/user-center/user-detail.php">个人主页</a></div>
                        <div><a href="javascript:volid(0)" onclick="logout()">退出</a></div>
                    </div>
            </div>
        </div>
    </div>
    <div class="search-wrap">
        <div class="search-title-wrap">
            <div class="search-title-icon"></div>
            <div class="search-title"><a href="index.php">haishuyun</a></div>
        </div>
        <div class="search-input-wrap">
            <input class="search-input" placeholder="请输入查询内容...">
            <div class="search-icon" onclick="toSearch()"></div>
        </div>
    </div>
    <div class="question-wrap">
        <div class="question">
            <div class="question-icon"></div>
            <div class="question-title">你知道阿尔萨斯之眼吗？</div>
            <div class="question-next-icon"></div>
        </div>
    </div>
    <div class="nav">
        <div><a href="">关注</a></div>
        <div><a href="">头条</a></div>
        <div><a href="/learning.php">知识</a></div>
        <div><a href="">政策法规</a></div>
        <div class="nav-product"><a href="product.php">产品服务</a></div>
        <div><a href="">招聘</a></div>
        <div><a href="">人物</a></div>
        <div><a href="">分享</a></div>
        <div><a href="">企业</a></div>
    </div>
    <div class="contain">
        <div class="condi">
            <div class="city">
                <div>所在城市：</div>
                <div class="city-list">
                    <div><a href="#">不限</a></div>
                    <div><a href="#">北京</a></div>
                    <div><a href="#">天津</a></div>
                    <div><a href="#">河北</a></div>
                    <div><a href="#">山西</a></div>
                    <div><a href="#">内蒙</a></div>
                    <div><a href="#">辽宁</a></div>
                    <div><a href="#">吉林</a></div>
                    <div><a href="#">黑龙江</a></div>
                    <div><a href="#">上海</a></div>
                    <div><a href="#">江苏</a></div>
                    <div><a href="#">浙江</a></div>
                    <div><a href="#">安徽</a></div>
                    <div><a href="#">福建</a></div>
                    <div><a href="#">厦门</a></div>
                    <div><a href="#">+更多</a></div>
                </div>
            </div>
            <div class="cate">
                <div>职位分类：</div>
                <div class="cate-list">
                    <div><a href="#">不限</a></div>
                    <div><a href="#">生活丨服务</a></div>
                    <div><a href="#">人力丨服务丨管理</a></div>
                    <div><a href="#">销售</a></div>
                    <div><a href="#">客服</a></div>
                    <div><a href="#">采购</a></div>
                    <div><a href="#">市场丨媒介</a></div>
                    <div><a href="#">广告丨设计</a></div>
                    <div><a href="#">+更多</a></div>
                </div>
            </div>
            <div class="salary">
                <div>职位薪资：</div>
                <div class="salary-list">
                    <div><a href="#">不限</a></div>
                    <div><a href="#">1000元以下</a></div>
                    <div><a href="#">1000-2000元</a></div>
                    <div><a href="#">2000-3000元</a></div>
                    <div><a href="#">3000-5000元</a></div>
                    <div><a href="#">5000-8000元</a></div>
                    <div><a href="#">8000-12000元</a></div>
                    <div><a href="#">12000元以上</a></div>
                </div>
            </div>
            <div class="more-condi">
                <div>更多筛选：</div>
                <div class="select-wrap">
                    <select>
                        <option>规模</option>
                    </select>
                    <select>
                        <option>工作经验</option>
                    </select>
                    <select>
                        <option>学历</option>
                    </select>
                    <select>
                        <option>更新时间</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="list">
            <div class="item">
                 <div class="item-left">
                     <div class="user-box">
                         <div class="user-thumb"><img src="/static/images/thumb.png"></div>
                         <div class="user-salary">7-9K</div>
                     </div>
                     <div class="job-box">
                         <div class="user-name-box">
                             <div class="user-name">祝枝山</div>
                             <div class="date-update">1天前更新</div>
                         </div>
                         <div class="user-des"><span>21岁</span><span>男</span><span>2年</span><span>本科</span><span>离职-随时到岗</span></div>
                         <div class="user-expect">求职期望：<span>重庆</span><span>UI设计师</span></div>
                         <div class="user-experience">曾经任职：<span>重庆长安汽车股份有限公司</span>、<span>重庆埃斯顿文化传媒有限公司</span>等5家企业</div>
                     </div>
                 </div>
                <div class="item-right">
                    <a href="javascript:void(0)">查看简历</a>
                </div>
            </div>
            <div class="item">
                <div class="item-left">
                    <div class="user-box">
                        <div class="user-thumb"><img src="/static/images/thumb.png"></div>
                        <div class="user-salary">7-9K</div>
                    </div>
                    <div class="job-box">
                        <div class="user-name-box">
                            <div class="user-name">祝枝山</div>
                            <div class="date-update">1天前更新</div>
                        </div>
                        <div class="user-des"><span>21岁</span><span>男</span><span>2年</span><span>本科</span><span>离职-随时到岗</span></div>
                        <div class="user-expect">求职期望：<span>重庆</span><span>UI设计师</span></div>
                        <div class="user-experience">曾经任职：<span>重庆长安汽车股份有限公司</span>、<span>重庆埃斯顿文化传媒有限公司</span>等5家企业</div>
                    </div>
                </div>
                <div class="item-right">
                    <a href="javascript:void(0)">查看简历</a>
                </div>
            </div>
            <div class="item">
                <div class="item-left">
                    <div class="user-box">
                        <div class="user-thumb"><img src="/static/images/thumb.png"></div>
                        <div class="user-salary">7-9K</div>
                    </div>
                    <div class="job-box">
                        <div class="user-name-box">
                            <div class="user-name">祝枝山</div>
                            <div class="date-update">1天前更新</div>
                        </div>
                        <div class="user-des"><span>21岁</span><span>男</span><span>2年</span><span>本科</span><span>离职-随时到岗</span></div>
                        <div class="user-expect">求职期望：<span>重庆</span><span>UI设计师</span></div>
                        <div class="user-experience">曾经任职：<span>重庆长安汽车股份有限公司</span>、<span>重庆埃斯顿文化传媒有限公司</span>等5家企业</div>
                    </div>
                </div>
                <div class="item-right">
                    <a href="javascript:void(0)">查看简历</a>
                </div>
            </div>
            <div class="item">
                <div class="item-left">
                    <div class="user-box">
                        <div class="user-thumb"><img src="/static/images/thumb.png"></div>
                        <div class="user-salary">7-9K</div>
                    </div>
                    <div class="job-box">
                        <div class="user-name-box">
                            <div class="user-name">祝枝山</div>
                            <div class="date-update">1天前更新</div>
                        </div>
                        <div class="user-des"><span>21岁</span><span>男</span><span>2年</span><span>本科</span><span>离职-随时到岗</span></div>
                        <div class="user-expect">求职期望：<span>重庆</span><span>UI设计师</span></div>
                        <div class="user-experience">曾经任职：<span>重庆长安汽车股份有限公司</span>、<span>重庆埃斯顿文化传媒有限公司</span>等5家企业</div>
                    </div>
                </div>
                <div class="item-right">
                    <a href="javascript:void(0)">查看简历</a>
                </div>
            </div>
        </div>
<!--        <div class="load-more">加载更多...</div>-->
    </div>
</div>
<div class="footer-wrap">
    <div class="footer">
        <div class="copyright">Copyright © 2023 海数云 版权所有 渝ICP备2022012388号</div>
        <div class="outer-link">
            <div><a href="">用户协议</a></div>
            <div><a href="">隐私政策</a></div>
            <div><a href="">媒体合作</a></div>
            <div><a href="">广告合作</a></div>
            <div><a href="">友情链接</a></div>
            <div><a href="">反馈建议</a></div>
        </div>
    </div>
</div>
<script>
    $(document).ready(function(){
        //获取本地用户信息
        let userinfo = getLocalUserinfo();
        if ( userinfo ){
            //不为空，显示用户信息
            console.log(userinfo);
            $(".login-register").css('display', 'none');
            $(".userinfo").css('display', 'flex');
            $(".userinfo img").attr('src', '/static/images/thumb.png');
            $(".userinfo span").html(userinfo.value.nickname);
        } else {
            //显示登录信息
            console.log('not login');
            $(".login-register").css('display', 'flex');
        }
        //获取默认数据列表
        getIndexList();

        $(".data-2x > img").attr('src', '/static/images/data-2x.png');
        $(".data-2x").mouseenter(function(){
            $(this).children(".data-2x-wrap").css('width', '690px');
        }).mouseleave(function(){
            $(this).children(".data-2x-wrap").css('width', '500px');
        })

        $(".data-1x > img").attr('src', '/static/images/data-1x.jpg');
        $(".data-1x").mouseenter(function(){
            $(this).children(".data-1x-wrap").css('height', '340px');
        }).mouseleave(function(){
            $(this).children(".data-1x-wrap").css('height', '170px');
        })

        $(".userinfo").mouseenter(function(){
            console.log('enter');
            $(".userinfo-op").css('display', 'flex');
        });
        $(".userinfo-op").mouseleave(function(){
            console.log('leave');
            $(".userinfo-op").css('display','none');
        })
    });

    //从storage获取用户信息
    function getLocalUserinfo(){
        let user = localStorage.getItem("userinfo");
        if ( !user === true){
            return false;
        }
        let storageTime = JSON.parse(user).time;
        let differTime = new Date().getTime() - storageTime;
        if ( differTime >= 2500000000){ //一个月左右，毫秒时间戳
            return false;
        } else {
            return JSON.parse(user);
        }
    }

    function logout(){
        window.localStorage.setItem("userinfo", "");
        window.location.reload();
    }

    function getIndexList(){
        $.ajax({
            type:'post',
            url:`${baseUrl}/api/article/index`,
            contentType:'application/json',
            data:{
                "type":'post',
            },
            success:function(res){
                console.log(res);
                // if ( res.message === "Success" ){
                //     let token =  res.data.token;
                //     let curtime = new Date().getTime();
                //     window.localStorage.setItem("tokenObj", JSON.stringify({token:token,time:curtime}));
                //     let tokenObj = localStorage.getItem("tokenObj");
                //     console.log(tokenObj);
                //     //window.localStorage.setItem('token', res.data.token);
                //     location.href = "index.php";
                // }
            },
            error:function(res){
                alert('fail');
            }
        });
    }

    function toSearch(){
        let keywords = $(".search-input").val();
        window.location.href = `search-result.php?keywords=${keywords}`;
    }

    function toUser(){
        let userId = 1;
        window.location.href = `../user-center/user-detail.php?userId=${userId}`;
    }
</script>
</body>
<script>

</script>
</html>